// Generated by tools/resource-gen.
// Run "make generate" to update this file.

// nolint:whitespace
package mesh

import (
	"errors"
	"fmt"

	mesh_proto "github.com/kumahq/kuma/api/mesh/v1alpha1"
	"github.com/kumahq/kuma/pkg/core/resources/model"
	"github.com/kumahq/kuma/pkg/core/resources/registry"
)

const (
	CircuitBreakerType model.ResourceType = "CircuitBreaker"
)

var _ model.Resource = &CircuitBreakerResource{}

type CircuitBreakerResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.CircuitBreaker
}

func NewCircuitBreakerResource() *CircuitBreakerResource {
	return &CircuitBreakerResource{
		Spec: &mesh_proto.CircuitBreaker{},
	}
}

func (t *CircuitBreakerResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *CircuitBreakerResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *CircuitBreakerResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *CircuitBreakerResource) Sources() []*mesh_proto.Selector {
	return t.Spec.GetSources()
}

func (t *CircuitBreakerResource) Destinations() []*mesh_proto.Selector {
	return t.Spec.GetDestinations()
}

func (t *CircuitBreakerResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.CircuitBreaker)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.CircuitBreaker{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *CircuitBreakerResource) Descriptor() model.ResourceTypeDescriptor {
	return CircuitBreakerResourceTypeDescriptor
}

var _ model.ResourceList = &CircuitBreakerResourceList{}

type CircuitBreakerResourceList struct {
	Items      []*CircuitBreakerResource
	Pagination model.Pagination
}

func (l *CircuitBreakerResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *CircuitBreakerResourceList) GetItemType() model.ResourceType {
	return CircuitBreakerType
}

func (l *CircuitBreakerResourceList) NewItem() model.Resource {
	return NewCircuitBreakerResource()
}

func (l *CircuitBreakerResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*CircuitBreakerResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*CircuitBreakerResource)(nil), r)
	}
}

func (l *CircuitBreakerResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *CircuitBreakerResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var CircuitBreakerResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                CircuitBreakerType,
	Resource:            NewCircuitBreakerResource(),
	ResourceList:        &CircuitBreakerResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "circuit-breakers",
	KumactlArg:          "circuit-breaker",
	KumactlListArg:      "circuit-breakers",
	AllowToInspect:      true,
	IsPolicy:            true,
	SingularDisplayName: "Circuit Breaker",
	PluralDisplayName:   "Circuit Breakers",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(CircuitBreakerResourceTypeDescriptor)
}

const (
	DataplaneType model.ResourceType = "Dataplane"
)

var _ model.Resource = &DataplaneResource{}

type DataplaneResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.Dataplane
}

func NewDataplaneResource() *DataplaneResource {
	return &DataplaneResource{
		Spec: &mesh_proto.Dataplane{},
	}
}

func (t *DataplaneResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *DataplaneResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *DataplaneResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *DataplaneResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.Dataplane)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.Dataplane{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *DataplaneResource) Descriptor() model.ResourceTypeDescriptor {
	return DataplaneResourceTypeDescriptor
}

var _ model.ResourceList = &DataplaneResourceList{}

type DataplaneResourceList struct {
	Items      []*DataplaneResource
	Pagination model.Pagination
}

func (l *DataplaneResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *DataplaneResourceList) GetItemType() model.ResourceType {
	return DataplaneType
}

func (l *DataplaneResourceList) NewItem() model.Resource {
	return NewDataplaneResource()
}

func (l *DataplaneResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*DataplaneResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*DataplaneResource)(nil), r)
	}
}

func (l *DataplaneResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *DataplaneResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var DataplaneResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                DataplaneType,
	Resource:            NewDataplaneResource(),
	ResourceList:        &DataplaneResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.ZoneToGlobalFlag,
	WsPath:              "dataplanes",
	KumactlArg:          "dataplane",
	KumactlListArg:      "dataplanes",
	AllowToInspect:      false,
	IsPolicy:            false,
	SingularDisplayName: "Dataplane",
	PluralDisplayName:   "Dataplanes",
	IsExperimental:      false,
	Insight:             NewDataplaneInsightResource(),
	Overview:            NewDataplaneOverviewResource(),
}

func init() {
	registry.RegisterType(DataplaneResourceTypeDescriptor)
}

const (
	DataplaneInsightType model.ResourceType = "DataplaneInsight"
)

var _ model.Resource = &DataplaneInsightResource{}

type DataplaneInsightResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.DataplaneInsight
}

func NewDataplaneInsightResource() *DataplaneInsightResource {
	return &DataplaneInsightResource{
		Spec: &mesh_proto.DataplaneInsight{},
	}
}

func (t *DataplaneInsightResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *DataplaneInsightResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *DataplaneInsightResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *DataplaneInsightResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.DataplaneInsight)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.DataplaneInsight{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *DataplaneInsightResource) Descriptor() model.ResourceTypeDescriptor {
	return DataplaneInsightResourceTypeDescriptor
}

var _ model.ResourceList = &DataplaneInsightResourceList{}

type DataplaneInsightResourceList struct {
	Items      []*DataplaneInsightResource
	Pagination model.Pagination
}

func (l *DataplaneInsightResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *DataplaneInsightResourceList) GetItemType() model.ResourceType {
	return DataplaneInsightType
}

func (l *DataplaneInsightResourceList) NewItem() model.Resource {
	return NewDataplaneInsightResource()
}

func (l *DataplaneInsightResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*DataplaneInsightResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*DataplaneInsightResource)(nil), r)
	}
}

func (l *DataplaneInsightResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *DataplaneInsightResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var DataplaneInsightResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                DataplaneInsightType,
	Resource:            NewDataplaneInsightResource(),
	ResourceList:        &DataplaneInsightResourceList{},
	ReadOnly:            true,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.ZoneToGlobalFlag,
	WsPath:              "dataplane-insights",
	KumactlArg:          "",
	KumactlListArg:      "",
	AllowToInspect:      false,
	IsPolicy:            false,
	SingularDisplayName: "Dataplane Insight",
	PluralDisplayName:   "Dataplane Insights",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(DataplaneInsightResourceTypeDescriptor)
}

const (
	DataplaneOverviewType model.ResourceType = "DataplaneOverview"
)

var _ model.Resource = &DataplaneOverviewResource{}

type DataplaneOverviewResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.DataplaneOverview
}

func NewDataplaneOverviewResource() *DataplaneOverviewResource {
	return &DataplaneOverviewResource{
		Spec: &mesh_proto.DataplaneOverview{},
	}
}

func (t *DataplaneOverviewResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *DataplaneOverviewResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *DataplaneOverviewResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *DataplaneOverviewResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.DataplaneOverview)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.DataplaneOverview{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *DataplaneOverviewResource) Descriptor() model.ResourceTypeDescriptor {
	return DataplaneOverviewResourceTypeDescriptor
}

func (t *DataplaneOverviewResource) SetOverviewSpec(resource model.Resource, insight model.Resource) error {
	t.SetMeta(resource.GetMeta())
	overview := &mesh_proto.DataplaneOverview{
		Dataplane: resource.GetSpec().(*mesh_proto.Dataplane),
	}
	if insight != nil {
		ins, ok := insight.GetSpec().(*mesh_proto.DataplaneInsight)
		if !ok {
			return errors.New("failed to convert to insight type 'DataplaneInsight'")
		}
		overview.DataplaneInsight = ins
	}
	return t.SetSpec(overview)
}

var _ model.ResourceList = &DataplaneOverviewResourceList{}

type DataplaneOverviewResourceList struct {
	Items      []*DataplaneOverviewResource
	Pagination model.Pagination
}

func (l *DataplaneOverviewResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *DataplaneOverviewResourceList) GetItemType() model.ResourceType {
	return DataplaneOverviewType
}

func (l *DataplaneOverviewResourceList) NewItem() model.Resource {
	return NewDataplaneOverviewResource()
}

func (l *DataplaneOverviewResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*DataplaneOverviewResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*DataplaneOverviewResource)(nil), r)
	}
}

func (l *DataplaneOverviewResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *DataplaneOverviewResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var DataplaneOverviewResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                DataplaneOverviewType,
	Resource:            NewDataplaneOverviewResource(),
	ResourceList:        &DataplaneOverviewResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	WsPath:              "",
	KumactlArg:          "",
	KumactlListArg:      "",
	AllowToInspect:      false,
	IsPolicy:            false,
	SingularDisplayName: "Dataplane Overview",
	PluralDisplayName:   "Dataplane Overviews",
	IsExperimental:      false,
}

const (
	ExternalServiceType model.ResourceType = "ExternalService"
)

var _ model.Resource = &ExternalServiceResource{}

type ExternalServiceResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.ExternalService
}

func NewExternalServiceResource() *ExternalServiceResource {
	return &ExternalServiceResource{
		Spec: &mesh_proto.ExternalService{},
	}
}

func (t *ExternalServiceResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *ExternalServiceResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *ExternalServiceResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *ExternalServiceResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.ExternalService)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.ExternalService{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *ExternalServiceResource) Descriptor() model.ResourceTypeDescriptor {
	return ExternalServiceResourceTypeDescriptor
}

var _ model.ResourceList = &ExternalServiceResourceList{}

type ExternalServiceResourceList struct {
	Items      []*ExternalServiceResource
	Pagination model.Pagination
}

func (l *ExternalServiceResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *ExternalServiceResourceList) GetItemType() model.ResourceType {
	return ExternalServiceType
}

func (l *ExternalServiceResourceList) NewItem() model.Resource {
	return NewExternalServiceResource()
}

func (l *ExternalServiceResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*ExternalServiceResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*ExternalServiceResource)(nil), r)
	}
}

func (l *ExternalServiceResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *ExternalServiceResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var ExternalServiceResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                ExternalServiceType,
	Resource:            NewExternalServiceResource(),
	ResourceList:        &ExternalServiceResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "external-services",
	KumactlArg:          "external-service",
	KumactlListArg:      "external-services",
	AllowToInspect:      false,
	IsPolicy:            false,
	SingularDisplayName: "External Service",
	PluralDisplayName:   "External Services",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(ExternalServiceResourceTypeDescriptor)
}

const (
	FaultInjectionType model.ResourceType = "FaultInjection"
)

var _ model.Resource = &FaultInjectionResource{}

type FaultInjectionResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.FaultInjection
}

func NewFaultInjectionResource() *FaultInjectionResource {
	return &FaultInjectionResource{
		Spec: &mesh_proto.FaultInjection{},
	}
}

func (t *FaultInjectionResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *FaultInjectionResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *FaultInjectionResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *FaultInjectionResource) Sources() []*mesh_proto.Selector {
	return t.Spec.GetSources()
}

func (t *FaultInjectionResource) Destinations() []*mesh_proto.Selector {
	return t.Spec.GetDestinations()
}

func (t *FaultInjectionResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.FaultInjection)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.FaultInjection{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *FaultInjectionResource) Descriptor() model.ResourceTypeDescriptor {
	return FaultInjectionResourceTypeDescriptor
}

var _ model.ResourceList = &FaultInjectionResourceList{}

type FaultInjectionResourceList struct {
	Items      []*FaultInjectionResource
	Pagination model.Pagination
}

func (l *FaultInjectionResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *FaultInjectionResourceList) GetItemType() model.ResourceType {
	return FaultInjectionType
}

func (l *FaultInjectionResourceList) NewItem() model.Resource {
	return NewFaultInjectionResource()
}

func (l *FaultInjectionResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*FaultInjectionResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*FaultInjectionResource)(nil), r)
	}
}

func (l *FaultInjectionResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *FaultInjectionResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var FaultInjectionResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                FaultInjectionType,
	Resource:            NewFaultInjectionResource(),
	ResourceList:        &FaultInjectionResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "fault-injections",
	KumactlArg:          "fault-injection",
	KumactlListArg:      "fault-injections",
	AllowToInspect:      true,
	IsPolicy:            true,
	SingularDisplayName: "Fault Injection",
	PluralDisplayName:   "Fault Injections",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(FaultInjectionResourceTypeDescriptor)
}

const (
	HealthCheckType model.ResourceType = "HealthCheck"
)

var _ model.Resource = &HealthCheckResource{}

type HealthCheckResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.HealthCheck
}

func NewHealthCheckResource() *HealthCheckResource {
	return &HealthCheckResource{
		Spec: &mesh_proto.HealthCheck{},
	}
}

func (t *HealthCheckResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *HealthCheckResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *HealthCheckResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *HealthCheckResource) Sources() []*mesh_proto.Selector {
	return t.Spec.GetSources()
}

func (t *HealthCheckResource) Destinations() []*mesh_proto.Selector {
	return t.Spec.GetDestinations()
}

func (t *HealthCheckResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.HealthCheck)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.HealthCheck{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *HealthCheckResource) Descriptor() model.ResourceTypeDescriptor {
	return HealthCheckResourceTypeDescriptor
}

var _ model.ResourceList = &HealthCheckResourceList{}

type HealthCheckResourceList struct {
	Items      []*HealthCheckResource
	Pagination model.Pagination
}

func (l *HealthCheckResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *HealthCheckResourceList) GetItemType() model.ResourceType {
	return HealthCheckType
}

func (l *HealthCheckResourceList) NewItem() model.Resource {
	return NewHealthCheckResource()
}

func (l *HealthCheckResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*HealthCheckResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*HealthCheckResource)(nil), r)
	}
}

func (l *HealthCheckResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *HealthCheckResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var HealthCheckResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                HealthCheckType,
	Resource:            NewHealthCheckResource(),
	ResourceList:        &HealthCheckResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "health-checks",
	KumactlArg:          "healthcheck",
	KumactlListArg:      "healthchecks",
	AllowToInspect:      true,
	IsPolicy:            true,
	SingularDisplayName: "Health Check",
	PluralDisplayName:   "Health Checks",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(HealthCheckResourceTypeDescriptor)
}

const (
	MeshType model.ResourceType = "Mesh"
)

var _ model.Resource = &MeshResource{}

type MeshResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.Mesh
}

func NewMeshResource() *MeshResource {
	return &MeshResource{
		Spec: &mesh_proto.Mesh{},
	}
}

func (t *MeshResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *MeshResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *MeshResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *MeshResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.Mesh)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.Mesh{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *MeshResource) Descriptor() model.ResourceTypeDescriptor {
	return MeshResourceTypeDescriptor
}

var _ model.ResourceList = &MeshResourceList{}

type MeshResourceList struct {
	Items      []*MeshResource
	Pagination model.Pagination
}

func (l *MeshResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *MeshResourceList) GetItemType() model.ResourceType {
	return MeshType
}

func (l *MeshResourceList) NewItem() model.Resource {
	return NewMeshResource()
}

func (l *MeshResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*MeshResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*MeshResource)(nil), r)
	}
}

func (l *MeshResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *MeshResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var MeshResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                MeshType,
	Resource:            NewMeshResource(),
	ResourceList:        &MeshResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeGlobal,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "meshes",
	KumactlArg:          "mesh",
	KumactlListArg:      "meshes",
	AllowToInspect:      false,
	IsPolicy:            false,
	SingularDisplayName: "Mesh",
	PluralDisplayName:   "Meshes",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(MeshResourceTypeDescriptor)
}

const (
	MeshGatewayType model.ResourceType = "MeshGateway"
)

var _ model.Resource = &MeshGatewayResource{}

type MeshGatewayResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.MeshGateway
}

func NewMeshGatewayResource() *MeshGatewayResource {
	return &MeshGatewayResource{
		Spec: &mesh_proto.MeshGateway{},
	}
}

func (t *MeshGatewayResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *MeshGatewayResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *MeshGatewayResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *MeshGatewayResource) Selectors() []*mesh_proto.Selector {
	return t.Spec.GetSelectors()
}

func (t *MeshGatewayResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.MeshGateway)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.MeshGateway{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *MeshGatewayResource) Descriptor() model.ResourceTypeDescriptor {
	return MeshGatewayResourceTypeDescriptor
}

var _ model.ResourceList = &MeshGatewayResourceList{}

type MeshGatewayResourceList struct {
	Items      []*MeshGatewayResource
	Pagination model.Pagination
}

func (l *MeshGatewayResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *MeshGatewayResourceList) GetItemType() model.ResourceType {
	return MeshGatewayType
}

func (l *MeshGatewayResourceList) NewItem() model.Resource {
	return NewMeshGatewayResource()
}

func (l *MeshGatewayResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*MeshGatewayResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*MeshGatewayResource)(nil), r)
	}
}

func (l *MeshGatewayResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *MeshGatewayResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var MeshGatewayResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                MeshGatewayType,
	Resource:            NewMeshGatewayResource(),
	ResourceList:        &MeshGatewayResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.ZoneToGlobalFlag | model.GlobalToAllZonesFlag,
	WsPath:              "meshgateways",
	KumactlArg:          "meshgateway",
	KumactlListArg:      "meshgateways",
	AllowToInspect:      false,
	IsPolicy:            true,
	SingularDisplayName: "Mesh Gateway",
	PluralDisplayName:   "Mesh Gateways",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(MeshGatewayResourceTypeDescriptor)
}

const (
	MeshGatewayRouteType model.ResourceType = "MeshGatewayRoute"
)

var _ model.Resource = &MeshGatewayRouteResource{}

type MeshGatewayRouteResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.MeshGatewayRoute
}

func NewMeshGatewayRouteResource() *MeshGatewayRouteResource {
	return &MeshGatewayRouteResource{
		Spec: &mesh_proto.MeshGatewayRoute{},
	}
}

func (t *MeshGatewayRouteResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *MeshGatewayRouteResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *MeshGatewayRouteResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *MeshGatewayRouteResource) Selectors() []*mesh_proto.Selector {
	return t.Spec.GetSelectors()
}

func (t *MeshGatewayRouteResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.MeshGatewayRoute)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.MeshGatewayRoute{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *MeshGatewayRouteResource) Descriptor() model.ResourceTypeDescriptor {
	return MeshGatewayRouteResourceTypeDescriptor
}

var _ model.ResourceList = &MeshGatewayRouteResourceList{}

type MeshGatewayRouteResourceList struct {
	Items      []*MeshGatewayRouteResource
	Pagination model.Pagination
}

func (l *MeshGatewayRouteResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *MeshGatewayRouteResourceList) GetItemType() model.ResourceType {
	return MeshGatewayRouteType
}

func (l *MeshGatewayRouteResourceList) NewItem() model.Resource {
	return NewMeshGatewayRouteResource()
}

func (l *MeshGatewayRouteResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*MeshGatewayRouteResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*MeshGatewayRouteResource)(nil), r)
	}
}

func (l *MeshGatewayRouteResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *MeshGatewayRouteResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var MeshGatewayRouteResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                MeshGatewayRouteType,
	Resource:            NewMeshGatewayRouteResource(),
	ResourceList:        &MeshGatewayRouteResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "meshgatewayroutes",
	KumactlArg:          "meshgatewayroute",
	KumactlListArg:      "meshgatewayroutes",
	AllowToInspect:      false,
	IsPolicy:            true,
	SingularDisplayName: "Mesh Gateway Route",
	PluralDisplayName:   "Mesh Gateway Routes",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(MeshGatewayRouteResourceTypeDescriptor)
}

const (
	MeshInsightType model.ResourceType = "MeshInsight"
)

var _ model.Resource = &MeshInsightResource{}

type MeshInsightResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.MeshInsight
}

func NewMeshInsightResource() *MeshInsightResource {
	return &MeshInsightResource{
		Spec: &mesh_proto.MeshInsight{},
	}
}

func (t *MeshInsightResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *MeshInsightResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *MeshInsightResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *MeshInsightResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.MeshInsight)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.MeshInsight{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *MeshInsightResource) Descriptor() model.ResourceTypeDescriptor {
	return MeshInsightResourceTypeDescriptor
}

var _ model.ResourceList = &MeshInsightResourceList{}

type MeshInsightResourceList struct {
	Items      []*MeshInsightResource
	Pagination model.Pagination
}

func (l *MeshInsightResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *MeshInsightResourceList) GetItemType() model.ResourceType {
	return MeshInsightType
}

func (l *MeshInsightResourceList) NewItem() model.Resource {
	return NewMeshInsightResource()
}

func (l *MeshInsightResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*MeshInsightResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*MeshInsightResource)(nil), r)
	}
}

func (l *MeshInsightResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *MeshInsightResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var MeshInsightResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                MeshInsightType,
	Resource:            NewMeshInsightResource(),
	ResourceList:        &MeshInsightResourceList{},
	ReadOnly:            true,
	AdminOnly:           false,
	Scope:               model.ScopeGlobal,
	WsPath:              "mesh-insights",
	KumactlArg:          "",
	KumactlListArg:      "",
	AllowToInspect:      false,
	IsPolicy:            false,
	SingularDisplayName: "Mesh Insight",
	PluralDisplayName:   "Mesh Insights",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(MeshInsightResourceTypeDescriptor)
}

const (
	ProxyTemplateType model.ResourceType = "ProxyTemplate"
)

var _ model.Resource = &ProxyTemplateResource{}

type ProxyTemplateResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.ProxyTemplate
}

func NewProxyTemplateResource() *ProxyTemplateResource {
	return &ProxyTemplateResource{
		Spec: &mesh_proto.ProxyTemplate{},
	}
}

func (t *ProxyTemplateResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *ProxyTemplateResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *ProxyTemplateResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *ProxyTemplateResource) Selectors() []*mesh_proto.Selector {
	return t.Spec.GetSelectors()
}

func (t *ProxyTemplateResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.ProxyTemplate)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.ProxyTemplate{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *ProxyTemplateResource) Descriptor() model.ResourceTypeDescriptor {
	return ProxyTemplateResourceTypeDescriptor
}

var _ model.ResourceList = &ProxyTemplateResourceList{}

type ProxyTemplateResourceList struct {
	Items      []*ProxyTemplateResource
	Pagination model.Pagination
}

func (l *ProxyTemplateResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *ProxyTemplateResourceList) GetItemType() model.ResourceType {
	return ProxyTemplateType
}

func (l *ProxyTemplateResourceList) NewItem() model.Resource {
	return NewProxyTemplateResource()
}

func (l *ProxyTemplateResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*ProxyTemplateResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*ProxyTemplateResource)(nil), r)
	}
}

func (l *ProxyTemplateResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *ProxyTemplateResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var ProxyTemplateResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                ProxyTemplateType,
	Resource:            NewProxyTemplateResource(),
	ResourceList:        &ProxyTemplateResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "proxytemplates",
	KumactlArg:          "proxytemplate",
	KumactlListArg:      "proxytemplates",
	AllowToInspect:      true,
	IsPolicy:            true,
	SingularDisplayName: "Proxy Template",
	PluralDisplayName:   "Proxy Templates",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(ProxyTemplateResourceTypeDescriptor)
}

const (
	RateLimitType model.ResourceType = "RateLimit"
)

var _ model.Resource = &RateLimitResource{}

type RateLimitResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.RateLimit
}

func NewRateLimitResource() *RateLimitResource {
	return &RateLimitResource{
		Spec: &mesh_proto.RateLimit{},
	}
}

func (t *RateLimitResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *RateLimitResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *RateLimitResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *RateLimitResource) Sources() []*mesh_proto.Selector {
	return t.Spec.GetSources()
}

func (t *RateLimitResource) Destinations() []*mesh_proto.Selector {
	return t.Spec.GetDestinations()
}

func (t *RateLimitResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.RateLimit)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.RateLimit{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *RateLimitResource) Descriptor() model.ResourceTypeDescriptor {
	return RateLimitResourceTypeDescriptor
}

var _ model.ResourceList = &RateLimitResourceList{}

type RateLimitResourceList struct {
	Items      []*RateLimitResource
	Pagination model.Pagination
}

func (l *RateLimitResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *RateLimitResourceList) GetItemType() model.ResourceType {
	return RateLimitType
}

func (l *RateLimitResourceList) NewItem() model.Resource {
	return NewRateLimitResource()
}

func (l *RateLimitResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*RateLimitResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*RateLimitResource)(nil), r)
	}
}

func (l *RateLimitResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *RateLimitResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var RateLimitResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                RateLimitType,
	Resource:            NewRateLimitResource(),
	ResourceList:        &RateLimitResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "rate-limits",
	KumactlArg:          "rate-limit",
	KumactlListArg:      "rate-limits",
	AllowToInspect:      true,
	IsPolicy:            true,
	SingularDisplayName: "Rate Limit",
	PluralDisplayName:   "Rate Limits",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(RateLimitResourceTypeDescriptor)
}

const (
	RetryType model.ResourceType = "Retry"
)

var _ model.Resource = &RetryResource{}

type RetryResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.Retry
}

func NewRetryResource() *RetryResource {
	return &RetryResource{
		Spec: &mesh_proto.Retry{},
	}
}

func (t *RetryResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *RetryResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *RetryResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *RetryResource) Sources() []*mesh_proto.Selector {
	return t.Spec.GetSources()
}

func (t *RetryResource) Destinations() []*mesh_proto.Selector {
	return t.Spec.GetDestinations()
}

func (t *RetryResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.Retry)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.Retry{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *RetryResource) Descriptor() model.ResourceTypeDescriptor {
	return RetryResourceTypeDescriptor
}

var _ model.ResourceList = &RetryResourceList{}

type RetryResourceList struct {
	Items      []*RetryResource
	Pagination model.Pagination
}

func (l *RetryResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *RetryResourceList) GetItemType() model.ResourceType {
	return RetryType
}

func (l *RetryResourceList) NewItem() model.Resource {
	return NewRetryResource()
}

func (l *RetryResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*RetryResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*RetryResource)(nil), r)
	}
}

func (l *RetryResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *RetryResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var RetryResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                RetryType,
	Resource:            NewRetryResource(),
	ResourceList:        &RetryResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "retries",
	KumactlArg:          "retry",
	KumactlListArg:      "retries",
	AllowToInspect:      true,
	IsPolicy:            true,
	SingularDisplayName: "Retry",
	PluralDisplayName:   "Retries",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(RetryResourceTypeDescriptor)
}

const (
	ServiceInsightType model.ResourceType = "ServiceInsight"
)

var _ model.Resource = &ServiceInsightResource{}

type ServiceInsightResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.ServiceInsight
}

func NewServiceInsightResource() *ServiceInsightResource {
	return &ServiceInsightResource{
		Spec: &mesh_proto.ServiceInsight{},
	}
}

func (t *ServiceInsightResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *ServiceInsightResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *ServiceInsightResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *ServiceInsightResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.ServiceInsight)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.ServiceInsight{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *ServiceInsightResource) Descriptor() model.ResourceTypeDescriptor {
	return ServiceInsightResourceTypeDescriptor
}

var _ model.ResourceList = &ServiceInsightResourceList{}

type ServiceInsightResourceList struct {
	Items      []*ServiceInsightResource
	Pagination model.Pagination
}

func (l *ServiceInsightResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *ServiceInsightResourceList) GetItemType() model.ResourceType {
	return ServiceInsightType
}

func (l *ServiceInsightResourceList) NewItem() model.Resource {
	return NewServiceInsightResource()
}

func (l *ServiceInsightResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*ServiceInsightResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*ServiceInsightResource)(nil), r)
	}
}

func (l *ServiceInsightResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *ServiceInsightResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var ServiceInsightResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                ServiceInsightType,
	Resource:            NewServiceInsightResource(),
	ResourceList:        &ServiceInsightResourceList{},
	ReadOnly:            true,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "service-insights",
	KumactlArg:          "",
	KumactlListArg:      "",
	AllowToInspect:      false,
	IsPolicy:            false,
	SingularDisplayName: "Service Insight",
	PluralDisplayName:   "Service Insights",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(ServiceInsightResourceTypeDescriptor)
}

const (
	ServiceOverviewType model.ResourceType = "ServiceOverview"
)

var _ model.Resource = &ServiceOverviewResource{}

type ServiceOverviewResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.ServiceInsight_Service
}

func NewServiceOverviewResource() *ServiceOverviewResource {
	return &ServiceOverviewResource{
		Spec: &mesh_proto.ServiceInsight_Service{},
	}
}

func (t *ServiceOverviewResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *ServiceOverviewResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *ServiceOverviewResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *ServiceOverviewResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.ServiceInsight_Service)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.ServiceInsight_Service{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *ServiceOverviewResource) Descriptor() model.ResourceTypeDescriptor {
	return ServiceOverviewResourceTypeDescriptor
}

var _ model.ResourceList = &ServiceOverviewResourceList{}

type ServiceOverviewResourceList struct {
	Items      []*ServiceOverviewResource
	Pagination model.Pagination
}

func (l *ServiceOverviewResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *ServiceOverviewResourceList) GetItemType() model.ResourceType {
	return ServiceOverviewType
}

func (l *ServiceOverviewResourceList) NewItem() model.Resource {
	return NewServiceOverviewResource()
}

func (l *ServiceOverviewResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*ServiceOverviewResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*ServiceOverviewResource)(nil), r)
	}
}

func (l *ServiceOverviewResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *ServiceOverviewResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var ServiceOverviewResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                ServiceOverviewType,
	Resource:            NewServiceOverviewResource(),
	ResourceList:        &ServiceOverviewResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	WsPath:              "",
	KumactlArg:          "",
	KumactlListArg:      "",
	AllowToInspect:      false,
	IsPolicy:            false,
	SingularDisplayName: "Service Overview",
	PluralDisplayName:   "Service Overviews",
	IsExperimental:      false,
}

const (
	TimeoutType model.ResourceType = "Timeout"
)

var _ model.Resource = &TimeoutResource{}

type TimeoutResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.Timeout
}

func NewTimeoutResource() *TimeoutResource {
	return &TimeoutResource{
		Spec: &mesh_proto.Timeout{},
	}
}

func (t *TimeoutResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *TimeoutResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *TimeoutResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *TimeoutResource) Sources() []*mesh_proto.Selector {
	return t.Spec.GetSources()
}

func (t *TimeoutResource) Destinations() []*mesh_proto.Selector {
	return t.Spec.GetDestinations()
}

func (t *TimeoutResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.Timeout)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.Timeout{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *TimeoutResource) Descriptor() model.ResourceTypeDescriptor {
	return TimeoutResourceTypeDescriptor
}

var _ model.ResourceList = &TimeoutResourceList{}

type TimeoutResourceList struct {
	Items      []*TimeoutResource
	Pagination model.Pagination
}

func (l *TimeoutResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *TimeoutResourceList) GetItemType() model.ResourceType {
	return TimeoutType
}

func (l *TimeoutResourceList) NewItem() model.Resource {
	return NewTimeoutResource()
}

func (l *TimeoutResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*TimeoutResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*TimeoutResource)(nil), r)
	}
}

func (l *TimeoutResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *TimeoutResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var TimeoutResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                TimeoutType,
	Resource:            NewTimeoutResource(),
	ResourceList:        &TimeoutResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "timeouts",
	KumactlArg:          "timeout",
	KumactlListArg:      "timeouts",
	AllowToInspect:      true,
	IsPolicy:            true,
	SingularDisplayName: "Timeout",
	PluralDisplayName:   "Timeouts",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(TimeoutResourceTypeDescriptor)
}

const (
	TrafficLogType model.ResourceType = "TrafficLog"
)

var _ model.Resource = &TrafficLogResource{}

type TrafficLogResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.TrafficLog
}

func NewTrafficLogResource() *TrafficLogResource {
	return &TrafficLogResource{
		Spec: &mesh_proto.TrafficLog{},
	}
}

func (t *TrafficLogResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *TrafficLogResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *TrafficLogResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *TrafficLogResource) Sources() []*mesh_proto.Selector {
	return t.Spec.GetSources()
}

func (t *TrafficLogResource) Destinations() []*mesh_proto.Selector {
	return t.Spec.GetDestinations()
}

func (t *TrafficLogResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.TrafficLog)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.TrafficLog{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *TrafficLogResource) Descriptor() model.ResourceTypeDescriptor {
	return TrafficLogResourceTypeDescriptor
}

var _ model.ResourceList = &TrafficLogResourceList{}

type TrafficLogResourceList struct {
	Items      []*TrafficLogResource
	Pagination model.Pagination
}

func (l *TrafficLogResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *TrafficLogResourceList) GetItemType() model.ResourceType {
	return TrafficLogType
}

func (l *TrafficLogResourceList) NewItem() model.Resource {
	return NewTrafficLogResource()
}

func (l *TrafficLogResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*TrafficLogResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*TrafficLogResource)(nil), r)
	}
}

func (l *TrafficLogResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *TrafficLogResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var TrafficLogResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                TrafficLogType,
	Resource:            NewTrafficLogResource(),
	ResourceList:        &TrafficLogResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "traffic-logs",
	KumactlArg:          "traffic-log",
	KumactlListArg:      "traffic-logs",
	AllowToInspect:      true,
	IsPolicy:            true,
	SingularDisplayName: "Traffic Log",
	PluralDisplayName:   "Traffic Logs",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(TrafficLogResourceTypeDescriptor)
}

const (
	TrafficPermissionType model.ResourceType = "TrafficPermission"
)

var _ model.Resource = &TrafficPermissionResource{}

type TrafficPermissionResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.TrafficPermission
}

func NewTrafficPermissionResource() *TrafficPermissionResource {
	return &TrafficPermissionResource{
		Spec: &mesh_proto.TrafficPermission{},
	}
}

func (t *TrafficPermissionResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *TrafficPermissionResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *TrafficPermissionResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *TrafficPermissionResource) Sources() []*mesh_proto.Selector {
	return t.Spec.GetSources()
}

func (t *TrafficPermissionResource) Destinations() []*mesh_proto.Selector {
	return t.Spec.GetDestinations()
}

func (t *TrafficPermissionResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.TrafficPermission)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.TrafficPermission{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *TrafficPermissionResource) Descriptor() model.ResourceTypeDescriptor {
	return TrafficPermissionResourceTypeDescriptor
}

var _ model.ResourceList = &TrafficPermissionResourceList{}

type TrafficPermissionResourceList struct {
	Items      []*TrafficPermissionResource
	Pagination model.Pagination
}

func (l *TrafficPermissionResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *TrafficPermissionResourceList) GetItemType() model.ResourceType {
	return TrafficPermissionType
}

func (l *TrafficPermissionResourceList) NewItem() model.Resource {
	return NewTrafficPermissionResource()
}

func (l *TrafficPermissionResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*TrafficPermissionResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*TrafficPermissionResource)(nil), r)
	}
}

func (l *TrafficPermissionResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *TrafficPermissionResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var TrafficPermissionResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                TrafficPermissionType,
	Resource:            NewTrafficPermissionResource(),
	ResourceList:        &TrafficPermissionResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "traffic-permissions",
	KumactlArg:          "traffic-permission",
	KumactlListArg:      "traffic-permissions",
	AllowToInspect:      true,
	IsPolicy:            true,
	SingularDisplayName: "Traffic Permission",
	PluralDisplayName:   "Traffic Permissions",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(TrafficPermissionResourceTypeDescriptor)
}

const (
	TrafficRouteType model.ResourceType = "TrafficRoute"
)

var _ model.Resource = &TrafficRouteResource{}

type TrafficRouteResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.TrafficRoute
}

func NewTrafficRouteResource() *TrafficRouteResource {
	return &TrafficRouteResource{
		Spec: &mesh_proto.TrafficRoute{},
	}
}

func (t *TrafficRouteResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *TrafficRouteResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *TrafficRouteResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *TrafficRouteResource) Sources() []*mesh_proto.Selector {
	return t.Spec.GetSources()
}

func (t *TrafficRouteResource) Destinations() []*mesh_proto.Selector {
	return t.Spec.GetDestinations()
}

func (t *TrafficRouteResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.TrafficRoute)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.TrafficRoute{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *TrafficRouteResource) Descriptor() model.ResourceTypeDescriptor {
	return TrafficRouteResourceTypeDescriptor
}

var _ model.ResourceList = &TrafficRouteResourceList{}

type TrafficRouteResourceList struct {
	Items      []*TrafficRouteResource
	Pagination model.Pagination
}

func (l *TrafficRouteResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *TrafficRouteResourceList) GetItemType() model.ResourceType {
	return TrafficRouteType
}

func (l *TrafficRouteResourceList) NewItem() model.Resource {
	return NewTrafficRouteResource()
}

func (l *TrafficRouteResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*TrafficRouteResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*TrafficRouteResource)(nil), r)
	}
}

func (l *TrafficRouteResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *TrafficRouteResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var TrafficRouteResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                TrafficRouteType,
	Resource:            NewTrafficRouteResource(),
	ResourceList:        &TrafficRouteResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "traffic-routes",
	KumactlArg:          "traffic-route",
	KumactlListArg:      "traffic-routes",
	AllowToInspect:      true,
	IsPolicy:            true,
	SingularDisplayName: "Traffic Route",
	PluralDisplayName:   "Traffic Routes",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(TrafficRouteResourceTypeDescriptor)
}

const (
	TrafficTraceType model.ResourceType = "TrafficTrace"
)

var _ model.Resource = &TrafficTraceResource{}

type TrafficTraceResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.TrafficTrace
}

func NewTrafficTraceResource() *TrafficTraceResource {
	return &TrafficTraceResource{
		Spec: &mesh_proto.TrafficTrace{},
	}
}

func (t *TrafficTraceResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *TrafficTraceResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *TrafficTraceResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *TrafficTraceResource) Selectors() []*mesh_proto.Selector {
	return t.Spec.GetSelectors()
}

func (t *TrafficTraceResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.TrafficTrace)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.TrafficTrace{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *TrafficTraceResource) Descriptor() model.ResourceTypeDescriptor {
	return TrafficTraceResourceTypeDescriptor
}

var _ model.ResourceList = &TrafficTraceResourceList{}

type TrafficTraceResourceList struct {
	Items      []*TrafficTraceResource
	Pagination model.Pagination
}

func (l *TrafficTraceResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *TrafficTraceResourceList) GetItemType() model.ResourceType {
	return TrafficTraceType
}

func (l *TrafficTraceResourceList) NewItem() model.Resource {
	return NewTrafficTraceResource()
}

func (l *TrafficTraceResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*TrafficTraceResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*TrafficTraceResource)(nil), r)
	}
}

func (l *TrafficTraceResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *TrafficTraceResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var TrafficTraceResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                TrafficTraceType,
	Resource:            NewTrafficTraceResource(),
	ResourceList:        &TrafficTraceResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "traffic-traces",
	KumactlArg:          "traffic-trace",
	KumactlListArg:      "traffic-traces",
	AllowToInspect:      true,
	IsPolicy:            true,
	SingularDisplayName: "Traffic Trace",
	PluralDisplayName:   "Traffic Traces",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(TrafficTraceResourceTypeDescriptor)
}

const (
	VirtualOutboundType model.ResourceType = "VirtualOutbound"
)

var _ model.Resource = &VirtualOutboundResource{}

type VirtualOutboundResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.VirtualOutbound
}

func NewVirtualOutboundResource() *VirtualOutboundResource {
	return &VirtualOutboundResource{
		Spec: &mesh_proto.VirtualOutbound{},
	}
}

func (t *VirtualOutboundResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *VirtualOutboundResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *VirtualOutboundResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *VirtualOutboundResource) Selectors() []*mesh_proto.Selector {
	return t.Spec.GetSelectors()
}

func (t *VirtualOutboundResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.VirtualOutbound)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.VirtualOutbound{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *VirtualOutboundResource) Descriptor() model.ResourceTypeDescriptor {
	return VirtualOutboundResourceTypeDescriptor
}

var _ model.ResourceList = &VirtualOutboundResourceList{}

type VirtualOutboundResourceList struct {
	Items      []*VirtualOutboundResource
	Pagination model.Pagination
}

func (l *VirtualOutboundResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *VirtualOutboundResourceList) GetItemType() model.ResourceType {
	return VirtualOutboundType
}

func (l *VirtualOutboundResourceList) NewItem() model.Resource {
	return NewVirtualOutboundResource()
}

func (l *VirtualOutboundResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*VirtualOutboundResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*VirtualOutboundResource)(nil), r)
	}
}

func (l *VirtualOutboundResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *VirtualOutboundResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var VirtualOutboundResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                VirtualOutboundType,
	Resource:            NewVirtualOutboundResource(),
	ResourceList:        &VirtualOutboundResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeMesh,
	KDSFlags:            model.GlobalToAllZonesFlag,
	WsPath:              "virtual-outbounds",
	KumactlArg:          "virtual-outbound",
	KumactlListArg:      "virtual-outbounds",
	AllowToInspect:      false,
	IsPolicy:            true,
	SingularDisplayName: "Virtual Outbound",
	PluralDisplayName:   "Virtual Outbounds",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(VirtualOutboundResourceTypeDescriptor)
}

const (
	ZoneEgressType model.ResourceType = "ZoneEgress"
)

var _ model.Resource = &ZoneEgressResource{}

type ZoneEgressResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.ZoneEgress
}

func NewZoneEgressResource() *ZoneEgressResource {
	return &ZoneEgressResource{
		Spec: &mesh_proto.ZoneEgress{},
	}
}

func (t *ZoneEgressResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *ZoneEgressResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *ZoneEgressResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *ZoneEgressResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.ZoneEgress)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.ZoneEgress{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *ZoneEgressResource) Descriptor() model.ResourceTypeDescriptor {
	return ZoneEgressResourceTypeDescriptor
}

var _ model.ResourceList = &ZoneEgressResourceList{}

type ZoneEgressResourceList struct {
	Items      []*ZoneEgressResource
	Pagination model.Pagination
}

func (l *ZoneEgressResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *ZoneEgressResourceList) GetItemType() model.ResourceType {
	return ZoneEgressType
}

func (l *ZoneEgressResourceList) NewItem() model.Resource {
	return NewZoneEgressResource()
}

func (l *ZoneEgressResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*ZoneEgressResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*ZoneEgressResource)(nil), r)
	}
}

func (l *ZoneEgressResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *ZoneEgressResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var ZoneEgressResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                ZoneEgressType,
	Resource:            NewZoneEgressResource(),
	ResourceList:        &ZoneEgressResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeGlobal,
	KDSFlags:            model.ZoneToGlobalFlag,
	WsPath:              "zoneegresses",
	KumactlArg:          "zoneegress",
	KumactlListArg:      "zoneegresses",
	AllowToInspect:      false,
	IsPolicy:            false,
	SingularDisplayName: "Zone Egress",
	PluralDisplayName:   "Zone Egresses",
	IsExperimental:      false,
	Insight:             NewZoneEgressInsightResource(),
	Overview:            NewZoneEgressOverviewResource(),
}

func init() {
	registry.RegisterType(ZoneEgressResourceTypeDescriptor)
}

const (
	ZoneEgressInsightType model.ResourceType = "ZoneEgressInsight"
)

var _ model.Resource = &ZoneEgressInsightResource{}

type ZoneEgressInsightResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.ZoneEgressInsight
}

func NewZoneEgressInsightResource() *ZoneEgressInsightResource {
	return &ZoneEgressInsightResource{
		Spec: &mesh_proto.ZoneEgressInsight{},
	}
}

func (t *ZoneEgressInsightResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *ZoneEgressInsightResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *ZoneEgressInsightResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *ZoneEgressInsightResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.ZoneEgressInsight)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.ZoneEgressInsight{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *ZoneEgressInsightResource) Descriptor() model.ResourceTypeDescriptor {
	return ZoneEgressInsightResourceTypeDescriptor
}

var _ model.ResourceList = &ZoneEgressInsightResourceList{}

type ZoneEgressInsightResourceList struct {
	Items      []*ZoneEgressInsightResource
	Pagination model.Pagination
}

func (l *ZoneEgressInsightResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *ZoneEgressInsightResourceList) GetItemType() model.ResourceType {
	return ZoneEgressInsightType
}

func (l *ZoneEgressInsightResourceList) NewItem() model.Resource {
	return NewZoneEgressInsightResource()
}

func (l *ZoneEgressInsightResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*ZoneEgressInsightResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*ZoneEgressInsightResource)(nil), r)
	}
}

func (l *ZoneEgressInsightResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *ZoneEgressInsightResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var ZoneEgressInsightResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                ZoneEgressInsightType,
	Resource:            NewZoneEgressInsightResource(),
	ResourceList:        &ZoneEgressInsightResourceList{},
	ReadOnly:            true,
	AdminOnly:           false,
	Scope:               model.ScopeGlobal,
	KDSFlags:            model.ZoneToGlobalFlag,
	WsPath:              "zoneegressinsights",
	KumactlArg:          "",
	KumactlListArg:      "",
	AllowToInspect:      false,
	IsPolicy:            false,
	SingularDisplayName: "Zone Egress Insight",
	PluralDisplayName:   "Zone Egress Insights",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(ZoneEgressInsightResourceTypeDescriptor)
}

const (
	ZoneEgressOverviewType model.ResourceType = "ZoneEgressOverview"
)

var _ model.Resource = &ZoneEgressOverviewResource{}

type ZoneEgressOverviewResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.ZoneEgressOverview
}

func NewZoneEgressOverviewResource() *ZoneEgressOverviewResource {
	return &ZoneEgressOverviewResource{
		Spec: &mesh_proto.ZoneEgressOverview{},
	}
}

func (t *ZoneEgressOverviewResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *ZoneEgressOverviewResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *ZoneEgressOverviewResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *ZoneEgressOverviewResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.ZoneEgressOverview)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.ZoneEgressOverview{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *ZoneEgressOverviewResource) Descriptor() model.ResourceTypeDescriptor {
	return ZoneEgressOverviewResourceTypeDescriptor
}

func (t *ZoneEgressOverviewResource) SetOverviewSpec(resource model.Resource, insight model.Resource) error {
	t.SetMeta(resource.GetMeta())
	overview := &mesh_proto.ZoneEgressOverview{
		ZoneEgress: resource.GetSpec().(*mesh_proto.ZoneEgress),
	}
	if insight != nil {
		ins, ok := insight.GetSpec().(*mesh_proto.ZoneEgressInsight)
		if !ok {
			return errors.New("failed to convert to insight type 'ZoneEgressInsight'")
		}
		overview.ZoneEgressInsight = ins
	}
	return t.SetSpec(overview)
}

var _ model.ResourceList = &ZoneEgressOverviewResourceList{}

type ZoneEgressOverviewResourceList struct {
	Items      []*ZoneEgressOverviewResource
	Pagination model.Pagination
}

func (l *ZoneEgressOverviewResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *ZoneEgressOverviewResourceList) GetItemType() model.ResourceType {
	return ZoneEgressOverviewType
}

func (l *ZoneEgressOverviewResourceList) NewItem() model.Resource {
	return NewZoneEgressOverviewResource()
}

func (l *ZoneEgressOverviewResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*ZoneEgressOverviewResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*ZoneEgressOverviewResource)(nil), r)
	}
}

func (l *ZoneEgressOverviewResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *ZoneEgressOverviewResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var ZoneEgressOverviewResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                ZoneEgressOverviewType,
	Resource:            NewZoneEgressOverviewResource(),
	ResourceList:        &ZoneEgressOverviewResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeGlobal,
	WsPath:              "",
	KumactlArg:          "",
	KumactlListArg:      "",
	AllowToInspect:      false,
	IsPolicy:            false,
	SingularDisplayName: "Zone Egress Overview",
	PluralDisplayName:   "Zone Egress Overviews",
	IsExperimental:      false,
}

const (
	ZoneIngressType model.ResourceType = "ZoneIngress"
)

var _ model.Resource = &ZoneIngressResource{}

type ZoneIngressResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.ZoneIngress
}

func NewZoneIngressResource() *ZoneIngressResource {
	return &ZoneIngressResource{
		Spec: &mesh_proto.ZoneIngress{},
	}
}

func (t *ZoneIngressResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *ZoneIngressResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *ZoneIngressResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *ZoneIngressResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.ZoneIngress)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.ZoneIngress{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *ZoneIngressResource) Descriptor() model.ResourceTypeDescriptor {
	return ZoneIngressResourceTypeDescriptor
}

var _ model.ResourceList = &ZoneIngressResourceList{}

type ZoneIngressResourceList struct {
	Items      []*ZoneIngressResource
	Pagination model.Pagination
}

func (l *ZoneIngressResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *ZoneIngressResourceList) GetItemType() model.ResourceType {
	return ZoneIngressType
}

func (l *ZoneIngressResourceList) NewItem() model.Resource {
	return NewZoneIngressResource()
}

func (l *ZoneIngressResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*ZoneIngressResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*ZoneIngressResource)(nil), r)
	}
}

func (l *ZoneIngressResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *ZoneIngressResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var ZoneIngressResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                ZoneIngressType,
	Resource:            NewZoneIngressResource(),
	ResourceList:        &ZoneIngressResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeGlobal,
	KDSFlags:            model.ZoneToGlobalFlag | model.GlobalToAllButOriginalZoneFlag,
	WsPath:              "zone-ingresses",
	KumactlArg:          "zone-ingress",
	KumactlListArg:      "zone-ingresses",
	AllowToInspect:      false,
	IsPolicy:            false,
	SingularDisplayName: "Zone Ingress",
	PluralDisplayName:   "Zone Ingresses",
	IsExperimental:      false,
	Insight:             NewZoneIngressInsightResource(),
	Overview:            NewZoneIngressOverviewResource(),
}

func init() {
	registry.RegisterType(ZoneIngressResourceTypeDescriptor)
}

const (
	ZoneIngressInsightType model.ResourceType = "ZoneIngressInsight"
)

var _ model.Resource = &ZoneIngressInsightResource{}

type ZoneIngressInsightResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.ZoneIngressInsight
}

func NewZoneIngressInsightResource() *ZoneIngressInsightResource {
	return &ZoneIngressInsightResource{
		Spec: &mesh_proto.ZoneIngressInsight{},
	}
}

func (t *ZoneIngressInsightResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *ZoneIngressInsightResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *ZoneIngressInsightResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *ZoneIngressInsightResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.ZoneIngressInsight)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.ZoneIngressInsight{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *ZoneIngressInsightResource) Descriptor() model.ResourceTypeDescriptor {
	return ZoneIngressInsightResourceTypeDescriptor
}

var _ model.ResourceList = &ZoneIngressInsightResourceList{}

type ZoneIngressInsightResourceList struct {
	Items      []*ZoneIngressInsightResource
	Pagination model.Pagination
}

func (l *ZoneIngressInsightResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *ZoneIngressInsightResourceList) GetItemType() model.ResourceType {
	return ZoneIngressInsightType
}

func (l *ZoneIngressInsightResourceList) NewItem() model.Resource {
	return NewZoneIngressInsightResource()
}

func (l *ZoneIngressInsightResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*ZoneIngressInsightResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*ZoneIngressInsightResource)(nil), r)
	}
}

func (l *ZoneIngressInsightResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *ZoneIngressInsightResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var ZoneIngressInsightResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                ZoneIngressInsightType,
	Resource:            NewZoneIngressInsightResource(),
	ResourceList:        &ZoneIngressInsightResourceList{},
	ReadOnly:            true,
	AdminOnly:           false,
	Scope:               model.ScopeGlobal,
	KDSFlags:            model.ZoneToGlobalFlag,
	WsPath:              "zone-ingress-insights",
	KumactlArg:          "",
	KumactlListArg:      "",
	AllowToInspect:      false,
	IsPolicy:            false,
	SingularDisplayName: "Zone Ingress Insight",
	PluralDisplayName:   "Zone Ingress Insights",
	IsExperimental:      false,
}

func init() {
	registry.RegisterType(ZoneIngressInsightResourceTypeDescriptor)
}

const (
	ZoneIngressOverviewType model.ResourceType = "ZoneIngressOverview"
)

var _ model.Resource = &ZoneIngressOverviewResource{}

type ZoneIngressOverviewResource struct {
	Meta model.ResourceMeta
	Spec *mesh_proto.ZoneIngressOverview
}

func NewZoneIngressOverviewResource() *ZoneIngressOverviewResource {
	return &ZoneIngressOverviewResource{
		Spec: &mesh_proto.ZoneIngressOverview{},
	}
}

func (t *ZoneIngressOverviewResource) GetMeta() model.ResourceMeta {
	return t.Meta
}

func (t *ZoneIngressOverviewResource) SetMeta(m model.ResourceMeta) {
	t.Meta = m
}

func (t *ZoneIngressOverviewResource) GetSpec() model.ResourceSpec {
	return t.Spec
}

func (t *ZoneIngressOverviewResource) SetSpec(spec model.ResourceSpec) error {
	protoType, ok := spec.(*mesh_proto.ZoneIngressOverview)
	if !ok {
		return fmt.Errorf("invalid type %T for Spec", spec)
	} else {
		if protoType == nil {
			t.Spec = &mesh_proto.ZoneIngressOverview{}
		} else {
			t.Spec = protoType
		}
		return nil
	}
}

func (t *ZoneIngressOverviewResource) Descriptor() model.ResourceTypeDescriptor {
	return ZoneIngressOverviewResourceTypeDescriptor
}

func (t *ZoneIngressOverviewResource) SetOverviewSpec(resource model.Resource, insight model.Resource) error {
	t.SetMeta(resource.GetMeta())
	overview := &mesh_proto.ZoneIngressOverview{
		ZoneIngress: resource.GetSpec().(*mesh_proto.ZoneIngress),
	}
	if insight != nil {
		ins, ok := insight.GetSpec().(*mesh_proto.ZoneIngressInsight)
		if !ok {
			return errors.New("failed to convert to insight type 'ZoneIngressInsight'")
		}
		overview.ZoneIngressInsight = ins
	}
	return t.SetSpec(overview)
}

var _ model.ResourceList = &ZoneIngressOverviewResourceList{}

type ZoneIngressOverviewResourceList struct {
	Items      []*ZoneIngressOverviewResource
	Pagination model.Pagination
}

func (l *ZoneIngressOverviewResourceList) GetItems() []model.Resource {
	res := make([]model.Resource, len(l.Items))
	for i, elem := range l.Items {
		res[i] = elem
	}
	return res
}

func (l *ZoneIngressOverviewResourceList) GetItemType() model.ResourceType {
	return ZoneIngressOverviewType
}

func (l *ZoneIngressOverviewResourceList) NewItem() model.Resource {
	return NewZoneIngressOverviewResource()
}

func (l *ZoneIngressOverviewResourceList) AddItem(r model.Resource) error {
	if trr, ok := r.(*ZoneIngressOverviewResource); ok {
		l.Items = append(l.Items, trr)
		return nil
	} else {
		return model.ErrorInvalidItemType((*ZoneIngressOverviewResource)(nil), r)
	}
}

func (l *ZoneIngressOverviewResourceList) GetPagination() *model.Pagination {
	return &l.Pagination
}

func (l *ZoneIngressOverviewResourceList) SetPagination(p model.Pagination) {
	l.Pagination = p
}

var ZoneIngressOverviewResourceTypeDescriptor = model.ResourceTypeDescriptor{
	Name:                ZoneIngressOverviewType,
	Resource:            NewZoneIngressOverviewResource(),
	ResourceList:        &ZoneIngressOverviewResourceList{},
	ReadOnly:            false,
	AdminOnly:           false,
	Scope:               model.ScopeGlobal,
	WsPath:              "",
	KumactlArg:          "",
	KumactlListArg:      "",
	AllowToInspect:      false,
	IsPolicy:            false,
	SingularDisplayName: "Zone Ingress Overview",
	PluralDisplayName:   "Zone Ingress Overviews",
	IsExperimental:      false,
}
